import { getRandomDateTime, getNowDate, getFeatureDate } from '../../../utils'
import Mock from 'mockjs'
export const configMock = pageSize => {
  const result: any[] = [
    {
      id: 1,
      category: '外链',
      name: '后台系统-接口地址',
      key: 'develop.apiDoc',
      type: 'string',
      dateType: 'datetime',
      isTimerange: false,
      value: 'https://www.apipost.cn/',
      remark: '开发系统时设置该值，在本系统内预览接口文档',
      creator: '1',
      create_time: getRandomDateTime(getFeatureDate(-10), getNowDate()),
      updater: '',
      update_time: '',
      deleted: false,
      deleted_time: ''
    },
    {
      id: 2,
      category: '外链',
      name: '后台系统-数据库监控',
      key: 'infra.monitor.database',
      type: 'string',
      dateType: 'datetime',
      isTimerange: false,
      value: 'https://www.runoob.com/mysql/mysql-tutorial.html',
      remark: '后端数据库监控相关外链页面',
      creator: '1',
      create_time: getRandomDateTime(getFeatureDate(-10), getNowDate()),
      updater: '',
      update_time: '',
      deleted: false,
      deleted_time: ''
    },
    {
      id: 3,
      category: '外链',
      name: '后台系统-监控平台',
      key: 'infra.monitor.platform',
      type: 'string',
      dateType: 'datetime',
      isTimerange: false,
      value: 'https://www.runoob.com/ollama/ollama-tutorial.html',
      remark: '后端的第三方监控平台外链页面',
      creator: '1',
      create_time: getRandomDateTime(getFeatureDate(-10), getNowDate()),
      updater: '',
      update_time: '',
      deleted: false,
      deleted_time: ''
    },
    {
      id: 4,
      category: '外链',
      name: '后台系统- redis 监控',
      key: 'infra.monitor.redis',
      type: 'string',
      dateType: 'datetime',
      isTimerange: false,
      value: 'https://www.redis.net.cn/',
      remark: 'redis 相关监控外链页面',
      creator: '1',
      create_time: getRandomDateTime(getFeatureDate(-10), getNowDate()),
      updater: '',
      update_time: '',
      deleted: false,
      deleted_time: ''
    },
    {
      id: 5,
      category: '外链',
      name: '后台系统- 服务监控',
      key: 'infra.monitor.server',
      type: 'string',
      dateType: 'datetime',
      isTimerange: false,
      value: 'https://www.runoob.com/php/php-tutorial.html',
      remark: '服务监控外链页面',
      creator: '1',
      create_time: getRandomDateTime(getFeatureDate(-10), getNowDate()),
      updater: '',
      update_time: '',
      deleted: false,
      deleted_time: ''
    }
  ]
  for (let i = 0; i < pageSize; i++) {
    result.push({
      id: i + 6,
      category: Mock.Random.word(5, 12),
      name: Mock.mock('@ctitle'),
      key: Mock.Random.word(5, 12),
      type: 'string',
      dateType: 'datetime',
      isTimerange: false,
      value: Mock.Random.word(5, 12),
      remark: Mock.mock('@csentence()'),
      creator: '1',
      create_time: getRandomDateTime(getFeatureDate(-10), getNowDate()),
      updater: '',
      update_time: '',
      deleted: false,
      deleted_time: ''
    })
  }
  return result
}
